<template>
  <div>
    <!-- 面包屑 -->
    <el-brand></el-brand>
    <!-- 添加按钮 -->
    <div>
        <el-button class="btn" type='primary' plain size='small' @click="add">添加</el-button>
    </div>
    <!-- 列表 -->
    <v-list @edit = 'edit'></v-list>
    <!-- 弹框 -->
    <v-dialog ref="dialogInfo" :info='info' @cancel='cancel'></v-dialog>
  </div>
</template>

<script>
import vList from './list.vue'
import vDialog from './dialog.vue'
export default {
  data() {
    return {
        info:{
            isShow:false,
            isAdd:true
        }
    };
  },
  methods: {
      add(){
          this.info.isShow = true
          this.info.isAdd = true
      },
      edit(e){
          this.info.isShow = true
          this.info.isAdd = false
          this.$refs.dialogInfo.lookup(e)
      },
      cancel(e){
          this.info.isShow = e
      },
      
  },
  components:{
      vList,
      vDialog
  }
};
</script>

<style  scoped>
.btn{
    margin:30px;
}
</style>
